import request from '@/utils/request'

export default {
    /**
     * 添加课程小节
     * @param {添加小节对象} video 
     */
    addVideo(video) {
        return request({
            url: '/eduservice/video/addVideo',
            method: 'post',
            data: video
          })
    },
    /**
     * 根据章节id查询小节信息
     * @param {小节id} videoId 
     */
    getVideoById(videoId) {
        return request({
            url: `/eduservice/video/getVideoById/${videoId}`,
            method: 'get'
          })
    },
    /**
     * 修改课程小节
     * @param {修改小节对象} video 
     */
    updateVideo(video) {
        return request({
            url: '/eduservice/video/updateVideo',
            method: 'post',
            data: video
          })
    },
    /**
     * 删除课程小节
     * @param {小节id} videoId 
     */
    deleteVideo(videoId) {
        return request({
            url: `/eduservice/video/remove/${videoId}`,
            method: 'delete'
          })
    },
    /**
     * 删除视频
     * @param {视频id} vodId 
     */
    deleteVodVideo(vodId) {
        return request({
            url: `/vodservice/removeVodVideo/${vodId}`,
            method: 'delete'
          })
    }
}
